<h1>{{editType}}折扣活动</h1>
<form name="userForm" novalidate>

    <div class="form-group">
        <label class="control-label">活动名称<span class="need">*</span></label>
        <input type="text" class="form-control" name="name" ng-model="discountActivity.name" />
    </div>


    <div class="form-group">

        <div class="form-group">
            <label class="control-label db">添加产品:</label>

            <div class="radio">
                <label>
                    <input type="radio" ng-model="discountActivity.suit"  value="all">
                    全场通用
                </label>
            </div>

            <div class="radio">
                <label>
                    <input type="radio" ng-model="discountActivity.suit" value="part">
                    部分适用
                </label>
            </div>

            <div ng-show="discountActivity.suit == 'part'">
                <a class="btn btn-primary btn-xs ml10" data-toggle="modal" data-target="#searchProductionModal"><span
                        class="glyphicon glyphicon-plus"></span></a>
                <div class="mt5">
                    <div ng-repeat="p in discountActivity.production track by $index" class="lg dib">
                        <span>产品名称:{{p.name}}</span>
                        <a ng-click="remove(p, discountActivity.production)">
                            <i class="remove ml2 cp glyphicon glyphicon-remove-sign glyphicon-white"></i></a>
                    </div>
                </div>
            </div>
        </div>


    </div>



    <div class="form-group">
        <label class="control-label db">开始时间:</label>
        <div  datetimepicker id="dt" ng-model="discountActivity.startTime"  class='input-group date'>
            <input type='text'   class="input-group-addon form-control lan" />
        </div>
    </div>



    <div class="form-group">
        <label class="control-label db">结束时间:</label>
        <div  datetimepicker id="de" ng-model="discountActivity.endTime"  class='input-group date'>
            <input type='text'   class="input-group-addon form-control lan" />
        </div>
    </div>


    <div class="form-group">
        <label class="control-label">折扣(填写0-10)<span class="need">*</span></label>
        <input type="number" class="form-control" name="name" ng-model="discountActivity.discount" />
    </div>



    <div class="form-group">
        <label class="control-label">每人限购</label>
        <input type="number" class="form-control" name="name" ng-model="discountActivity.limitBuy" />
    </div>


    <div class="form-group">
        <label class="control-label">标签</label>
        <input type="text" class="form-control" name="name" ng-model="discountActivity.tag" />
    </div>

    <div class="mt20 fix">
    <button class="btn btn-primary" ng-click="save()">保存</button>
    <button class="btn btn-link" ng-click="reset()">重置</button>
    </div>

</form>

<div class="modal fade" id="searchProductionModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button"
                        class="close"
                        data-dismiss="modal"
                        aria-hidden="true">x</button>
                <h3 id="userMgrLabel">搜索产品</h3>
            </div>
            <div class="modal-body">

                <form name="userForm" class="form-horizontal" role="form">
                    <div class="form-group" >
                        <label class="col-sm-2 control-label">搜索按</label>
                        <label class="radio-inline">
                            <input type="radio" name="inlineRadioOptions" id="inlineRadio1" ng-model="searchProType" selected value="name"> 产品名或编码
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="inlineRadioOptions" id="inlineRadio2" ng-model="searchProType" value="tag"> 标签
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="inlineRadioOptions" id="inlineRadio3" ng-model="searchProType" value="summary">简介
                        </label>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-2 control-label">关键词</label>
                        <div class="col-sm-10">
                            <ng-autocomplete class="ltw" ng-model="editRelation"
                                             show-property="name"
                                             delay="300"
                                             theme="blue"
                                             init-text=""
                                             get-result="searchProduction(keyword)"
                                             placeholder="搜索产品">
                            </ng-autocomplete>
                            <a class="btn btn-primary btn-xs ml10" ng-click="addProduction(editRelation)"><span
                                    class="glyphicon glyphicon-plus"></span></a>
                        </div>
                    </div>




                </form>

            </div>
            <div class="modal-footer">
                <button class="btn" data-dismiss="modal" aria-hidden="true">取消</button>
                <button class="btn btn-primary"
                        data-dismiss="modal"
                        aria-hidden="true"
                >确定</button>
            </div>
        </div>
    </div>
</div>


